package protocol

import "net"

type ProtocolInstance struct {
	conn *net.TCPConn
}

func (inst *ProtocolInstance) SetConn(conn *net.TCPConn) {
	inst.conn = conn
}
func (inst *ProtocolInstance) Send(data string) (int, error) {
	return inst.conn.Write([]byte(data))
}
func (inst *ProtocolInstance) GetHost() string {
	return inst.conn.RemoteAddr().String()
}
func (inst *ProtocolInstance) CloseConnection() {
	inst.conn.Close()
}
